//
//  NSTimer+Safe.m
//  TableViewTestDemo
//
//  Created by 张蒙召 on 2021/3/5.
//  Copyright © 2021 张蒙召. All rights reserved.
//

#import "NSTimer+Safe.h"

@implementation NSTimer (Safe)

+ (NSTimer *)safe_timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget repeats:(BOOL)yesOrNo block:(void(^)(void))block  {
    NSLog(@"OrderKit version=0.3.0");
    return  [NSTimer scheduledTimerWithTimeInterval:ti target:self selector:@selector(handle:) userInfo:[block copy] repeats:YES];
    
}
+ (void)handle:(NSTimer *)timer {
    void(^block)(void) = timer.userInfo;
    if (block) {
        block();
    }
}
@end
